import {
    http3,
    http4
} from "@/service/axios";

// 获取部门列表
export function getDepartment(data) {
    return http3.get({
        url: "/user/dept/tree",
        data,
    });
}

// 角色列表
export function getRole(data) {
    return http3.get({
        url: "/user/role/list",
        data,
    });
}

// 新增用户
export function getAddCashier(data) {
    return http4.post({
        url: "/user/add",
        data,
    });
}

// 编辑用户
export function getEditCashier(data) {
    return http4.post({
        url: "/user/edit",
        data,
    });
}

// 用户列表
export function getUser(data) {
    return http4.post({
        url: "/user/list",
        data,
    });
}

// 重启/停用账号按钮
export function getAccountStatus(data) {
    return http4.post({
        url: "/user/status/edit",
        data,
    });
}

// 重置密码
export function getResetpwd(data) {
    return http4.post({
        url: `/user/pwd/reset/${data}`,
        data,
    });
}

// 人员信息导入模板下载接口
export function getExportUser(data) {
    return http4.get({
        url: `/user/import/template/download`,
        data,
        responseType: "blob",
    });
}

// 日志
export function getJournal(data) {
    return http4.post({
        url: `/user/opt/list/${data.userId}`,
        data,
    });
}